package com.rpm.rpm.login.login;

import com.alibaba.fastjson.JSONObject;
import com.rpm.rpm.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户表控制层
 */
@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private LoginService service;

    /**
     * 注册方法
     * @param param
     * @return
     */
    @RequestMapping("/register")
    public ResultVO register(@RequestBody JSONObject param){
        ResultVO resultVO = new ResultVO();
        return service.register(param,resultVO);
    }

    /**
     * 登录方法
     * @param param
     * @return
     */
    @RequestMapping("/login")
    public ResultVO login(@RequestBody JSONObject param){
        ResultVO resultVO = new ResultVO();
        return service.login(param,resultVO);
    }
}
